<html>
<head><meta charset="utf-8"><title>hello and a question · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html">hello and a question</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211800574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211800574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211800574">(Sep 30 2020 at 18:22)</a>:</h4>
<p>Hello! <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> </p>
<p>I love simd, i have used it in big projects (x86 intrinsics only though), and i love the premise of std::simd, therefore this project has a lot of value for me. I had just one question, <a href="https://github.com/rust-lang/stdsimd/pull/10/files#diff-f68c0b0d5d2d8d30e501dc8e4b157051">this file</a> states these intrinsics are lowered by rustc into llvm stuff. Where are the docs for the available functions? is <a href="https://llvm.org/docs/LangRef.html#id2337">this</a> the place? if so, how would functions like cos and sin be implemented, im not aware of intrinsics for those functions, thanks <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="211801304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801304">(Sep 30 2020 at 18:28)</a>:</h4>
<p>Unfortunately those intrinsics aren't actually documented anywhere, so those docs were my best efforts from reading through github issues and a bit of the rustc source.  I believe trig functions will be implemented by directly linking against llvm, rather than using <code>platform-intrinsic</code>.  I would take a look at how it's implemented in packed-simd for inspiration</p>



<a name="211801365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801365">(Sep 30 2020 at 18:29)</a>:</h4>
<p>How come stdsimd was made from scratch instead of extending packed_simd?</p>



<a name="211801607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801607">(Sep 30 2020 at 18:31)</a>:</h4>
<p>A mandate from libs, essentially.<br>
There was not enough confidence on the libs team that the packed_simd design is the best one as-is.</p>



<a name="211801704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801704">(Sep 30 2020 at 18:32)</a>:</h4>
<p>Oh i found it, yeah thats direct linking to llvm items, thats pretty hardcore haha, but i guess thats the only way <br>
<a href="https://github.com/rust-lang/packed_simd/blob/master/src/codegen/math/float/cos.rs">https://github.com/rust-lang/packed_simd/blob/master/src/codegen/math/float/cos.rs</a></p>



<a name="211801726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801726">(Sep 30 2020 at 18:32)</a>:</h4>
<p>Ah i see, makes sense</p>



<a name="211801785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801785">(Sep 30 2020 at 18:33)</a>:</h4>
<p>Other SIMD libs have popped up recently to address particular concerns with packed_simd, so the idea is to learn lessons from all of them, I think</p>



<a name="211801838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801838">(Sep 30 2020 at 18:33)</a>:</h4>
<p>It is going to look very similar, as two of the team members have authored their own simd crates and literally everyone converged on "very like packed_simd", but "exactly the same" was the sticking point.</p>



<a name="211801840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801840">(Sep 30 2020 at 18:33)</a>:</h4>
<p>Are there any particular concerns with packed simd which led to wanting to rewrite it?</p>



<a name="211801985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801985">(Sep 30 2020 at 18:34)</a>:</h4>
<p>You may be overestimating the amount of rewriting that is going to go on if you start from the assumption that it is being "made from scratch".</p>



<a name="211801988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211801988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211801988">(Sep 30 2020 at 18:34)</a>:</h4>
<p>A particular concern of mine, at least, is a somewhat overcomplicated interface (the SIMD types are all implemented by a single generic type)</p>



<a name="211802035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802035">(Sep 30 2020 at 18:34)</a>:</h4>
<p>Yeah i found that pretty odd that they are all a wrapper around <code>Simd&lt;/* */&gt;</code></p>



<a name="211802063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802063">(Sep 30 2020 at 18:35)</a>:</h4>
<p>But agreed, it's definitely not "from scratch" at least as far as design goes</p>



<a name="211802082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802082">(Sep 30 2020 at 18:35)</a>:</h4>
<p>Yeah some things definitely look similar</p>



<a name="211802202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802202">(Sep 30 2020 at 18:36)</a>:</h4>
<p>If i wanted to impl basic float ops like cos, sin, tan, etc would i use the same direct linking method as packed_simd or were there discussions of doing it another way?</p>



<a name="211802707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802707">(Sep 30 2020 at 18:40)</a>:</h4>
<p>probably just called to the simd llvm trig intrinsics will be sufficient to start with.</p>



<a name="211802726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802726">(Sep 30 2020 at 18:40)</a>:</h4>
<p>I believe linking to LLVM is correct.  We should be careful to check the LLVM docs to ensure we don't perform any undefined behavior though--packed_simd has a few soundness issues there</p>



<a name="211802774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802774">(Sep 30 2020 at 18:40)</a>:</h4>
<p>What is the reason for this fixme? <code>FIXME 64-bit fabsgle elem vectors</code>, occurs with other float intrinsics too</p>



<a name="211802844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802844">(Sep 30 2020 at 18:41)</a>:</h4>
<p>is that in packed_simd?<br>
If it is, the answer is: I have no idea.</p>



<a name="211802891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802891">(Sep 30 2020 at 18:42)</a>:</h4>
<p>haha alright</p>



<a name="211802964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211802964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211802964">(Sep 30 2020 at 18:42)</a>:</h4>
<p>No idea either, but looking at the LLVM docs, some platforms don't support fabs, which is the only thing that stands out to me</p>



<a name="211803011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803011">(Sep 30 2020 at 18:42)</a>:</h4>
<p>Yeah im wondering how stdsimd will handle that, will there be fallbacks?</p>



<a name="211803016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803016">(Sep 30 2020 at 18:42)</a>:</h4>
<p>However my guess is that's _probably_ referring to 80 bit floats and not 32- or 64-bit</p>



<a name="211803027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803027">(Sep 30 2020 at 18:43)</a>:</h4>
<p>Oh interesting</p>



<a name="211803065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803065">(Sep 30 2020 at 18:43)</a>:</h4>
<p>Yes, anything that doesn't work on vectors will certainly at least have scalar fallbacks</p>



<a name="211803072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803072">(Sep 30 2020 at 18:43)</a>:</h4>
<p>that doesn't sound right.</p>



<a name="211803205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803205">(Sep 30 2020 at 18:44)</a>:</h4>
<p>which part?</p>



<a name="211803303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803303">(Sep 30 2020 at 18:45)</a>:</h4>
<p>that it's referring to 80 bit floats.</p>



<a name="211803317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803317">(Sep 30 2020 at 18:45)</a>:</h4>
<p><a href="https://llvm.org/docs/LangRef.html#llvm-fabs-intrinsic">https://llvm.org/docs/LangRef.html#llvm-fabs-intrinsic</a> here's the doc if you're curious</p>



<a name="211803343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803343">(Sep 30 2020 at 18:46)</a>:</h4>
<p>the example has 80- and 128-bit floats from what I can tell</p>



<a name="211803464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803464">(Sep 30 2020 at 18:46)</a>:</h4>
<p>"gle"?</p>



<a name="211803473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803473">(Sep 30 2020 at 18:46)</a>:</h4>
<p>hmm.</p>



<a name="211803494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803494">(Sep 30 2020 at 18:47)</a>:</h4>
<p>Still wondering about that part</p>



<a name="211803536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803536">(Sep 30 2020 at 18:47)</a>:</h4>
<p>Its referring to 64 bit however, so i dont think 80/128 bit items are the issue here</p>



<a name="211803556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211803556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211803556">(Sep 30 2020 at 18:47)</a>:</h4>
<p>good point...</p>



<a name="211853541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211853541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Horacio Hidalgo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211853541">(Sep 30 2020 at 23:41)</a>:</h4>
<p>hello</p>



<a name="211853557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211853557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211853557">(Sep 30 2020 at 23:41)</a>:</h4>
<p>Please feel free to ask questions!</p>



<a name="211856028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211856028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211856028">(Oct 01 2020 at 00:18)</a>:</h4>
<p>or rather, hello!</p>



<a name="211858945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211858945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211858945">(Oct 01 2020 at 01:07)</a>:</h4>
<p>Specifically in the case of float abs: that's easy enough to implement on our own if there's any trouble. You just <code>&amp;</code> with all bits except the sign bit.</p>



<a name="211859330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211859330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211859330">(Oct 01 2020 at 01:15)</a>:</h4>
<p><span aria-label="musical score" class="emoji emoji-1f3bc" role="img" title="musical score">:musical_score:</span> Whack that bit <span aria-label="music" class="emoji emoji-1f3b5" role="img" title="music">:music:</span><br>
<span aria-label="music" class="emoji emoji-1f3b5" role="img" title="music">:music:</span>  Give the AST a slip <span aria-label="musical notes" class="emoji emoji-1f3b6" role="img" title="musical notes">:musical_notes:</span><br>
<span aria-label="musical notes" class="emoji emoji-1f3b6" role="img" title="musical notes">:musical_notes:</span> Push stuff on the stack <span aria-label="music" class="emoji emoji-1f3b5" role="img" title="music">:music:</span> <br>
<span aria-label="music" class="emoji emoji-1f3b5" role="img" title="music">:music:</span> Break a server rack <span aria-label="musical notes" class="emoji emoji-1f3b6" role="img" title="musical notes">:musical_notes:</span></p>



<a name="211965128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/211965128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Roland Ruckerbauer <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#211965128">(Oct 01 2020 at 19:53)</a>:</h4>
<p>Hi there!</p>
<p>I think I will stay around in this chat for a while, and see how it develops ;-)</p>



<a name="227437876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227437876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227437876">(Feb 23 2021 at 14:27)</a>:</h4>
<p>Hello guys, </p>
<p>I have a couple of questions for you as I think this group is probably the best one to ask it<br>
(if not then I'm really sorry and please forward me to some better place)</p>
<p>I know fast-math for Rust can't be turned on via LLVM -ffast-math switch but there are some<br>
core intrinsics which from my experience work surprisingly well. </p>
<ol>
<li>
<p>What's the relation between fast-math and SIMD in the context of Rust?<br>
I read Locathor's github post that those things are orthogonal and LLVM can use both<br>
of them at the same time. Is that true?</p>
</li>
<li>
<p>Could fast-math intrinsics be combined with SIMD calls (for performance gains)? Would it make sense at all?</p>
</li>
<li>
<p>Are there any plans to allow fast-math to be enabled for certain crates in Rust via some<br>
sort of feature? </p>
</li>
<li>
<p>Does fast-math even matter when using SIMD ?</p>
</li>
<li>Do I understand correctly that this new portable-simd initiative is meant as a replacement for packed-simd crate?</li>
</ol>
<p>Thanks!</p>



<a name="227446831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227446831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227446831">(Feb 23 2021 at 15:18)</a>:</h4>
<p>fast-math lets llvm do floating point optimizations, but other than that it's not very connected to SIMD, and it's not something this group is aiming for.</p>
<p>It's potentially harder than SIMD to get right XD</p>



<a name="227446865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227446865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227446865">(Feb 23 2021 at 15:18)</a>:</h4>
<p>but yes, we do aim to replace the packed-simd crate</p>



<a name="227447415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227447415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227447415">(Feb 23 2021 at 15:22)</a>:</h4>
<p>Hey - thanks for getting back to me! Do you know how C/C++ handle those orthogonal functionalities? Why this fast math stuff is so complicated? Do you have some resources describing this issue?</p>



<a name="227447951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227447951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227447951">(Feb 23 2021 at 15:25)</a>:</h4>
<p>I'm new to Rust and I'm literally overwhelmed with things to learn, but I'm very much interested in SIMD features and I see Rust can do this quite elegantly</p>



<a name="227448725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227448725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227448725">(Feb 23 2021 at 15:31)</a>:</h4>
<p>C/C++ don't really handle them.  Fast math is hard because it makes some well behaved things much faster, but for "general purpose" math it can cause some very unexpected and probably "incorrect" results.</p>



<a name="227449090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227449090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227449090">(Feb 23 2021 at 15:33)</a>:</h4>
<p>A possible approach in rust would be to provide functions or types that allow certain special optimizations, like allowing reordering of operations to be more efficient.  It's critical to not introduce undefined behavior though, which some optimizations might cause</p>



<a name="227449228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227449228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227449228">(Feb 23 2021 at 15:34)</a>:</h4>
<p>SIMD is only related to the extent that these special functions or types could also exist for SIMD floating point types</p>



<a name="227449634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227449634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227449634">(Feb 23 2021 at 15:37)</a>:</h4>
<p>Got it, thanks. I'm mostly interested because in the case of for example DSP audio code or games fast math is something you can have as long as you algorithm is stable and the game... well... works :-) <br>
I tracked several discussions for fast math, but now I understand it's a different story and not for this stream/channel<br>
So if I understand correctly portable simd is supposed to create a facade for SIMD types and instructions that are deconstructed based on desired CPU architecture and used with LLVM SIMD intrinsics. Is that correct?</p>



<a name="227450063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227450063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227450063">(Feb 23 2021 at 15:39)</a>:</h4>
<p>More or less, yep.  That's the foundation at least, certain algorithms such as trigonometry will go beyond just intrinsics</p>



<a name="227450276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227450276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227450276">(Feb 23 2021 at 15:41)</a>:</h4>
<p>The goal is to use rust's type system to make SIMD as convenient as possible to write</p>



<a name="227450372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227450372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227450372">(Feb 23 2021 at 15:41)</a>:</h4>
<p>That's actually pretty neat if you ask me :)</p>



<a name="227450535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227450535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227450535">(Feb 23 2021 at 15:42)</a>:</h4>
<p>Are there even SIMD trigonometry intrinsics ? I saw some @llvm.sin.f32 stuff - is this the one you're talking about ?</p>



<a name="227450947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227450947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227450947">(Feb 23 2021 at 15:45)</a>:</h4>
<p>Yeah there are, though it's a complicated saga and the summary is we need to implement them ourselves</p>



<a name="227451021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227451021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227451021">(Feb 23 2021 at 15:45)</a>:</h4>
<p>That's what the "libm" thread in this group is about</p>



<a name="227451330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227451330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227451330">(Feb 23 2021 at 15:47)</a>:</h4>
<p>Yeah, I saw the libm discussion on github, but I don't I understand it yet. Ok, those answers should be enough for me for now - thank you very much and thank you for all your hard work!</p>



<a name="227456403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227456403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227456403">(Feb 23 2021 at 16:10)</a>:</h4>
<p>don't worry, we barely understand it either, so you're in good company.<br>
will concede, "barely" is possibly a lot more than "at all", so don't feel bad about it taking a bit to get up to that even if you put effort into it.</p>



<a name="227458181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/hello%20and%20a%20question/near/227458181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> NBot <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/hello.20and.20a.20question.html#227458181">(Feb 23 2021 at 16:19)</a>:</h4>
<p>Haha, well .. you know definitely more than I do :-) Thanks again!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>